
#include "tcpclient.h"
#include "tcpclient_impl.h"
#include <iostream>

TcpClient::TcpClient(boost::asio::io_service& io_service,
	boost::asio::ip::tcp::resolver::iterator& endpoint_iterator,
	const ClientConfig_t& cfg,
	const MessageType_t& messageTypes)
	:_pImpl(new TcpClientImpl(io_service, endpoint_iterator, cfg, messageTypes))
{
}

TcpClient::~TcpClient()
{
	delete _pImpl;
}
void TcpClient::write(TcpMessage& msg)
{
	return _pImpl->write(msg);
}

void TcpClient::close()
{
	return _pImpl->close();
}


MessageBus<>& TcpClient::messagebus()
{
	return _pImpl->messagebus();
}